## 模板1
import os

env = None
Enable_Clang = False
# 1.编译器
if Enable_Clang and os.system("which clang") == 0:
    # clang编译器
    env = Environment(tools=["default", "clang"])
    env["CC"] = ["clang"]
    env["CXX"] = ["clang++"]
else:
    env = Environment()

env["PROGSUFFIX"] = ".out"              # 可执行文件后缀.out
env["CCFLAGS"] = " -g3 -O0 -Wall"       # gdb 调试

sources=0
ccflags=1
linkflags=2
target_list = [
    "11_SimapleFactoryMethod_简单工厂模式.cc",
    "21_Builder_建造者模式.cc",
    "31_AbstractFactory_抽象工厂模式.cc",
    "41_Prototype_原型模式.cc",
    "51_Singleton_单实例模式.cc",
        "52_Singleton_Parttern_通过call_once单实例模式.cc",
        "53_Singleton_单实例模式.cc",
    "61_InterpreterMethod_解释器模式.cc",
]
for target in target_list:
    if isinstance(target,(str)):
        env.Program(Split(target))
    elif isinstance(target,(list)):
        env.Program(Split(target[sources]),CCFLAGS=target[ccflags]+env["CCFLAGS"],LINKFLAGS=target[linkflags]+env["LINKFLAGS"])
